# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=remmina
epoch=1
pkgver=1.4.30
pkgrel=1
pkgdesc="remote desktop client written in GTK+"
url="https://www.remmina.org/"
arch=('loong64' 'x86_64')
license=('GPL')
depends=('avahi' 'libgcrypt' 'libssh' 'vte3' 'libsodium' 'libayatana-appindicator' 'libsoup3')
makedepends=('cmake' 'freerdp' 'libvncserver' 'spice-gtk' 'spice-protocol'
             'harfbuzz' 'xorgproto' 'gobject-introspection' 'kwallet'
             'webkit2gtk-4.1' 'gtk-vnc' 'ninja')
optdepends=('freerdp: RDP plugin'
            'libsecret: Secret plugin'
            'libvncserver: VNC plugin'
            'spice-gtk: Spice plugin'
#            'pyhoca-cli: X2Go plugin'
            'webkit2gtk-4.1: WWW plugin'
            'gtk-vnc: GVNC plugin'
            'kwallet: kwallet plugin'
            'gnome-terminal: external tools')
replaces=('remmina-plugins')
provides=('remmina-plugins')
source=("$pkgname-$pkgver.tar.bz2::https://gitlab.com/Remmina/Remmina/-/archive/v${pkgver/rc/-rc}/Remmina-v${pkgver/rc/-rc}.tar.bz2")
sha512sums=('4e2beb4fd27bd9060a95735bd43ee80260d036bb59c406aa0d9ef63fcbd04c6e358384416b2308367d88a1f87d6e1af42299a21d59fd06dce785b9cfe1b67c84')

build() {
  cmake -S Remmina-v${pkgver/rc/-rc} -B build -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DWITH_APPINDICATOR=ON \
    -DWITH_NEWS=OFF \
    -DWITH_KF5WALLET=ON \
    -DWITH_X2GO=ON \
    -DWITH_GVNC=ON
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
